﻿<%@ Page Title="" Language="C#" MasterPageFile="~/module/Fontend.Master" AutoEventWireup="true" CodeBehind="TeacherWarning.aspx.cs" Inherits="mamnontuoitho7.module.TeacherWarning" ValidateRequest="false" %>
<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<div class="accounts">
    <div class="login-name">
        <div class="login-name-left"></div>
        <span class="login-name-middle"><%= Session["fullname"].ToString()%></span>
        <div class="login-name-right"></div>
    </div>
    <div class="block-menu">
        <ul>
            <li><a href="TeacherConversation.aspx">Các cuộc hội thoại</a></li>
            <li><a href="TeacherKidList.aspx">Danh sách Bé</a></li>
            <li class="active">Thông báo</li>
            <li><a href="TeacherProfile.aspx">Thông tin tài khoản</a></li>
            <li><a href="ChangeAvatar.aspx">Thay đổi Avatar</a></li>
        </ul>
    </div>

    <div class="block-content">
        <form runat="server" id="Form1">
            <div class="blockform">
                <h1 class="send-warning">Viết thông báo mới tới phụ huynh của lớp: <%=_className%></h1>
                <%--<asp:TextBox ID="txtWarning2" runat="server" TextMode="MultiLine"></asp:TextBox><br />--%>
                <CKEditor:CKEditorControl ID="ckeWarning" BasePath="~/scripts/tools/ckeditor" CustomConfig="CustomUser.js"  runat="server" MaxLength="3450"></CKEditor:CKEditorControl>
                <asp:Button ID="btnWarningSend" runat="server" CssClass="buttons" Text="Gửi" 
                    onclick="btnWarningSend_Click" />
            </div>
        </form>
        <div class="blocktable">
            <h1 class="list-wraning">Các thông báo cũ của lớp:</h1>
            <table width="100%">
                <tr>
                    <td>
                        <table cellpadding="0" cellspacing="0" border="0" id="table" class="tinytable">
                            <thead>
                                <tr>
                                    <!--vị trí header list-->
                                    
                                    <th>
                                        <h3>
                                            <asp:Label ID="Label6" runat="server" Text='Nôi dung'></asp:Label></h3>
                                    </th>
                                    <th>
                                         <h3>
                                            <asp:Label ID="Label1" runat="server" Text='Người đăng' /></h3>
                                    </th>
                                    <th class="nosort">
                                        <h3>
                                            <asp:Label ID="Label27" runat="server" Text='Ngày' /></h3>
                                    </th>
                                    
                                    <th class="nosort">
                                        <h3>
                                            <asp:Label ID="Label22" runat="server" Text='Xóa' /></h3>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <!--vị trí content list-->
                                <%
                                    /* write code get datatable show into for loop */
                                    for (int i = 0; i < _dt.Rows.Count; i++)
                                    {
                                %>
                                <tr>
                                    <td>
                                        <%=_dt.Rows[i]["NoticeContent"].ToString()%>
                                    </td>
                                    <td style="min-width: 110px;">
                                         <%= _dt.Rows[i]["FullName"].ToString()%>
                                    </td>
                                    <td style="text-align:center;width: 70px;">
                                       <%= DateTime.Parse(_dt.Rows[i]["CreateDate"].ToString()).ToString("dd/MM/yyyy")%>
                                    </td>
                                    <td style="text-align:center;width: 40px;">
                                        <%if (_notice.checkNoticeOwnerForTeacher(Session["memberID"].ToString(), _dt.Rows[i]["NoticeID"].ToString())) 
                                          {%>
                                             <a href="TeacherWarning.aspx?NoticeIDDelete=<%=_dt.Rows[i]["NoticeID"].ToString()%>" onclick="javascript: if (confirm('Bạn muốn xóa bản tin này?')) { window.location.href='#' } else { return false; };">
                                                    <img alt="Xóa" src="../scripts/tools/table/images/delete.png" style="border:none;"/></a>
                                         <%} %>
                                    </td>
                                </tr>
                                <% } %>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </table>
        </div>  
    </div>
   
    <div id="container">
        <div class="pagination">
            <%if (_currentbar > 1)
              { %>
            <a href="TeacherWarning.aspx?a=-1" class="pageblue"><<</a>
            <%} %>
            <%  

                for (int j = _beginPage; j <= _endPage; j++)
                {
                    if (j == _pageflag)
                    {
            
            %>
            <a href="TeacherWarning.aspx?page=<%= j%>" class="pageblue active"><%= j%></a>
            <% }else
               { %>
            <a href="TeacherWarning.aspx?page=<%= j%>" class="pageblue"><%= j%></a>
            <%  }
                } %>
            <%if (_currentbar < _totalBars)
              { %>
            <a href="TeacherWarning.aspx?a=1" class="pageblue">>></a>
            <%} %>
        </div>
    </div>
</div>
</asp:Content>
